home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / nihcl-30.lha / nihcl-3.0 / ex / VehicleQ.c < prev    next >
C/C++ Source or Header  |  1990-05-15  |  889b  |  41 lines

  1. // VehicleQ.c -- Vehicle Queue LinkedList
  2.  
  3. #include "VehicleQ.h"
  4. #include "QLink.h"
  5. #include "nihclIO.h"
  6.  
  7. #define THIS    VehicleQ
  8. #define BASE    LinkedList
  9. #define BASE_CLASSES BASE::desc()
  10. #define MEMBER_CLASSES
  11. #define VIRTUAL_BASE_CLASSES
  12.  
  13. DEFINE_CLASS(VehicleQ,1,"$Header: /afs/alw.nih.gov/unix/sun4_40c/usr/local/src/nihcl-3.0/share/ex/RCS/VehicleQ.c,v 3.0 90/05/15 22:44:11 kgorlen Rel $",NULL,NULL);
  14.  
  15. Link& VehicleQ::linkCastdown(Object& p) const
  16. {
  17.     return QLink::castdown(p);
  18. }
  19.  
  20. void VehicleQ::addVehicle(QLink& l) { add(l); }
  21.  
  22. void VehicleQ::removeVehicle(QLink& l)  { remove(l); }
  23.  
  24. VehicleQ::VehicleQ(OIOin& strm) :
  25.     Object(strm),
  26.     LinkedList()
  27. {
  28.     unsigned n;
  29.     strm >> n;
  30.     while (n--) add(*QLink::readFrom(strm));
  31. }
  32.  
  33. VehicleQ::VehicleQ(OIOifd& fd) :
  34.     Object(fd),
  35.     LinkedList()
  36. {
  37.     unsigned n;
  38.     fd >> n;
  39.     while (n--) add(*QLink::readFrom(fd));
  40. }
  41.